<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Penduduk extends CI_Controller {
    
    function __construct() { //inisialisasi library dan helper yang perlu di load
        parent::__construct();
        $this->load->helper('form');
        $this->load->model('berbah');
    }
    
    function index(){
        $data['title'] = 'Penduduk';
        $data['isi'] = $this->berbah->get_pndk();
        $this->load->view('penduduk',$data);
    }
    
    function show(){
        $nik = $id = $this->uri->segment(3);
        if ($data['isi'] = $this->berbah->get_pndk_nik($nik)) {
            $data['isi'] = $this->berbah->get_pndk_nik($nik);
        } else {
            $data['isi'] = array();
        }
        $data['title'] = 'Penduduk Detail';
        $this->load->view('penduduk_detail',$data);
    }
}

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
